package com.atguigu.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;

/**
 * @author zhengwu
 * @email jiachao@163.com
 * @date 2020-10-08 21:49:59
 */
@Data
@TableName("pms_category")
public class CategoryEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId(value = "cat_id", type = IdType.AUTO)
    private Long catId;
    /**
     *
     */
    private String name;
    /**
     *
     */
    private Long parentCid;
    /**
     *
     */
    private Integer catLevel;
    /**
     *
     */
    @TableLogic //这个注解是实现逻辑删除
    private Integer showStatus;
    /**
     *
     */
    private Integer sort;
    /**
     * ͼ
     */
    private String icon;
    /**
     *
     */
    private String productUnit;
    /**
     *
     */
    private Integer productCount;

    //添加子分类属性
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 这个字段表示为空的时候不会返回给前端
    @TableField(exist = false)//次注解表示该属性不属于表的字段
    private List<CategoryEntity> children;
}
